package com.jt.demo1;
/*演示使用set方法注入属性*/
public class Book {
    //创建属性
    private String bname;
    private String bauthor;
    private String baddress;
    //set方法注入
    public void setBname(String bname) {
        this.bname = bname;
    }
    public void setBauthor(String bauthor) {
        this.bauthor = bauthor;
    }

    public void setBaddress(String baddress) {
        this.baddress = baddress;
    }

    public void testDemo(){
        System.out.println(bname+":"+bauthor);
    }
}
